---
id: overview
title: Overview
sidebar_label: Overview
sidebar_position: 1
---

Call `forMember()` and pass in a `Selector` along with a `MemberMapFunction` to customize the [MappingTransformation](../../fundamentals/mapping#mappingtransformation) of a particular property on the `Destination`

<figure>
    <img
        src={require('../../../static/for-member.gif').default}
        alt="ForMember gif to showcase developer experience"
    />
    <figcaption align="center">
        <em>
            <code>forMember()</code> is strongly-typed, providing good developer
            experience with autocomplete
        </em>
    </figcaption>
</figure>

:::caution

To iterate once again, if the Mapping has a lot of `forMember()`, it is time to re-evaluate the models.

:::

## PreCondition

Call `preCondition()` before a `MemberMapFunction` will tell AutoMapper to do a pre-check against some condition before executing the `MemberMapFunction`.

`preCondition()` takes a `predicateFn` that will be called with the `sourceObject` and an optional `defaultValue` that will be assigned to the configured property if `preCondtion()` check yields falsy

```ts
createMap(
    mapper,
    User,
    UserDto,
    forMember(
        (destination) => destination.fullName,
        preCondition((source) => source.age > 10, 'default full name'),
        mapFrom(fullNameResolver)
    )
);
```
